package com.example.human_resource_management.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.human_resource_management.entry.po.Training;
import com.example.human_resource_management.service.TrainingService;
import com.example.human_resource_management.mapper.TrainingMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Lenovo
 * @description 针对表【training(培训表)】的数据库操作Service实现
 * @createDate 2025-06-09 14:39:54
 */
@Service
public class TrainingServiceImpl extends ServiceImpl<TrainingMapper, Training>
        implements TrainingService {

    @Autowired
    private TrainingMapper trainingMapper;

    @Override
    public List<Training> selectTrainingList() {
        return this.list();
    }

    @Override
    public boolean addTraining(Training training) {
        return this.save(training);
    }

    @Override
    public boolean updateTraining(Training training) {
        return this.updateById(training);
    }

    @Override
    public boolean deleteTraining(Long trainId) {
        return this.removeById(trainId);
    }
}